package bank;

import java.util.HashSet;
import java.util.Set;

/**
 * Decisions to make:
 * 1. packages: comprehensibility + variativity
 * 2. points of variativity: уже есть (чтобы не было дублирования) +
 * понимание бизнес-модели
 * 3. creational  patterns: creator [GRASP] | Factory[static -> repo, object, ] | DI (assembler -?)
 */
public class BankApp {
    public static void main(String[] args) {
        Set<Client> clients = new HashSet<>();

        Set<Account> accountForClient1 = new HashSet<>();
        accountForClient1.add(new SavingAccount());
        accountForClient1.add(new CheckingAccount());
        clients.add(new Client(accountForClient1));

        Bank bank = new Bank(clients);



        /*
        Bank bank = new Bank( new Client( new SavingAccount() ) );
         */
    }
}

class Bank {
//    @Inject
//    @Autowired
    Set<Client> clients;

    public Bank(Set<Client> clients) {
        this.clients = clients;
    }
}

interface Account {}

class SavingAccount implements Account {}
class CheckingAccount implements Account {}

class Client {
    Set<Account> accounts;

    public Client(Set<Account> accounts) {
        this.accounts = accounts;
    }
}
